#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::on_btnOpen_clicked()
{
    QString curPath=QDir::currentPath();
    QString dlgTitle="选择一个文件";
    QString filter="文本文件（*.txt）;;图片文件(*.jpg *.gif);;所有文件(*.*)";
    QString aFileName=QFileDialog::getOpenFileName(this,dlgTitle,curPath,filter);
    if(!aFileName.isEmpty()){
      ui->plainTextEdit->appendPlainText(aFileName);
    }

}
